package com.ecy.quadratic.request;

import com.ecy.quadratic.beans.ComicSectionDetailResponseBean;
import com.google.gson.Gson;

import java.util.HashMap;

public class ComicSectionDetailRequest extends BasicRequest<ComicSectionDetailResponseBean> {

    private String mUrl;

    public ComicSectionDetailRequest(HashMap<String, String> params, String url) {
        super(params);
        mUrl = url;
    }

    @Override
    protected ComicSectionDetailResponseBean convert(String result) {
        System.out.println("result:" + result);
        ComicSectionDetailResponseBean bean = new ComicSectionDetailResponseBean();
        Gson gson = new Gson();
        try {
            bean = gson.fromJson(result, ComicSectionDetailResponseBean.class);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return bean;
    }

    @Override
    protected String getUrl() {
        return mUrl;
    }

    @Override
    protected HashMap<String, String> getHeaders() {
        return null;
    }

    @Override
    protected String method() {
        return "get";
    }

}
